#!/bin/bash
#
#	Purpose:
#		守护一个进程重复执行, Use `while` Circle
#
#	History:	2014.05.21 Potter First Version
#
echo "My Pid = $$"
while true; do
	ping -c 3 www.baidu.com > /dev/null &
	# echo "Result: $?"
	if [ "$?" != "0" ]; then
		echo "你已断网..."
	else
		echo "联网成功..."
	fi

	sleep 3
done
